home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / hppa / machparam.h < prev    next >
Text File  |  1995-02-14  |  2KB  |  68 lines

  1. /* 
  2.  * Copyright (c) 1993 NeXT, Inc. All rights reserved.
  3.  *
  4.  * HISTORY
  5.  *
  6.  * 12-Jul-93 Mac Gillon at NeXT
  7.  *    Created from i386 version.
  8.  */ 
  9.  
  10. #ifndef    _HPPA_MACHPARAM_
  11. #define    _HPPA_MACHPARAM_
  12.  
  13. #import <mach/vm_param.h>
  14.  
  15. /*
  16.  * Machine dependent 'constants'.
  17.  */
  18. #define    NBPG    PAGE_SIZE    /* bytes/page */
  19. #define    PGOFSET    (NBPG-1)    /* byte offset into page */
  20. #define    PGSHIFT    PAGE_SHIFT    /* LOG2(NBPG) */
  21.  
  22. #define    CLSIZE            1
  23. #define    CLSIZELOG2        0
  24.  
  25. /* FIXME - we may not need this */
  26.  
  27. #define SSIZE        4        /* initial stack size/NBPG */
  28. #define SINCR        4        /* increment of stack/NBPG */
  29. #define USIZE        3         /* number of ptes needed to map uarea */
  30.                                     /* USIZE must be sizeof(struct u)  */
  31.                                     /* rounded up to nearest page + 1 */
  32.  
  33. #define STACKSIZE 4            /* pages in kernel stack */
  34. #define    UPAGES    (USIZE+STACKSIZE)    /* total pages in u-area */
  35.                     /* red zone is beyond this */
  36.  
  37. /*
  38.  * Some macros for units conversion
  39.  */
  40. /* Core clicks (NeXT_page_size bytes) to segments and vice versa */
  41. #define    ctos(x)    (x)
  42. #define    stoc(x)    (x)
  43.  
  44. /* clicks to bytes */
  45. #define    ctob(x)    ((x) << PGSHIFT)
  46.  
  47. /* bytes to clicks */
  48. #define    btoc(x)    ((((unsigned)(x)+PGOFSET) >> PGSHIFT))
  49.  
  50. /*
  51.  * Decode privilege level for HP Precision Architecture.
  52.  */
  53. #define PC_PRIV_MASK    3
  54. #define PC_PRIV_KERN    0
  55. #define PC_PRIV_USER    3
  56.  
  57. #define USERMODE(ssp)    (((((struct pcb_entry_state *)ssp)->es_pcoq_front) & PC_PRIV_MASK) != PC_PRIV_KERN)
  58. #define BASEPRI(ssp)    (((struct pcb_entry_state *)ssp)->es_eiem == SPL0)
  59.  
  60. #if    defined(KERNEL) || defined(STANDALONE)
  61. #define    DELAY(n) us_spin(n)
  62.  
  63. #else    defined(KERNEL) || defined(STANDALONE)
  64. #define    DELAY(n)    { register int N = (n); while (--N > 0); }
  65. #endif    defined(KERNEL) || defined(STANDALONE)
  66.  
  67. #endif    _HPPA_MACHPARAM_
  68.